﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net.Mail;
using System.Configuration; 


namespace websitev2.Core
{
    public class Email
    {

        public static bool SendPlainEmail(string SendTo, string SubjectLine, string EmailBody)
        {
            bool _return = true; 
            try
            {
               
                MailMessage oMessage = new MailMessage("noreply@startstop.me", SendTo, SubjectLine, EmailBody);
                SmtpClient oSMTP = new SmtpClient(ConfigurationManager.AppSettings["smtp.server"].ToString());
                oSMTP.Send(oMessage);
            }
            catch
            {
                // SMTP couldn't be found, so we should do something here to log the error. 
            }

            return _return; 
        }

    }
}